import org.molamil.acto.mc.mcw.LcMcWrapper;

/**
 * <code>LcMcWrapper</code> that delegates the state change to the MC. When changing the
 * <code>state</code> property of the MC, the wrapper state is changed automatically.
 *
 * @author Jorge Hernandez
 */
class org.molamil.acto.mc.mcw.McDelegate extends LcMcWrapper {
		
	
	// Functions
	
	private function stateWatchCallback(prop:Object, oldVal:Object, newVal:Object, instance:McDelegate):Object  {
		instance.state = String(newVal);
		return newVal;
	}
	
	
	// Getter/Setter
	
	public function set mc(mc:MovieClip):Void {
		super.mc = mc;
		mc.watch("state", stateWatchCallback, this);
	}
	
	
}